<template>
  <div class="rightPanel-container">
    <div class="rightPanel" @click="drawer = true" :style="{'background-color':color}">
      <i class="el-icon-setting"></i>
    </div>
    <el-drawer :with-header="false" :visible.sync="drawer" :direction="direction" size='260px'>
      <div class="drawer-container">
        <h3 class="title">系统配置</h3>
        <div class="flex drawer-item">
          <div>主题色</div>
          <color-picker />
        </div>
      </div>
    </el-drawer>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  components: {
    colorPicker: () => import("@/components/ColorPicker"),
  },
  data() {
    return {
      drawer: false,
      direction: "rtl",
    };
  },
  computed: {
    ...mapGetters(["color"]),
  },
};
</script>

<style lang="scss" scoped>
.rightPanel-container {
  .rightPanel {
    width: 48px;
    height: 48px;
    text-align: center;
    border-radius: 6px 0 0 6px !important;
    cursor: pointer;
    color: #fff;
    position: fixed;
    top: 250px;
    right: 0px;
    z-index: 99;
    i {
      font-size: 24px;
      line-height: 48px;
    }
  }
  .drawer-container {
    padding: 24px;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    .title {
      font-size: 14px;
      color: #333;
    }
  }
}
</style>
